$(function () {
    ${entity?uncap_first}Form.init();
});
var ${entity?uncap_first}Form = {
    init: function () {
        // 表单验证
        ${entity?uncap_first}Form.initValidator();
        // 保存提交按钮事件绑定
        common.btnSaveAndCanel(${entity?uncap_first}Form);
    },
    initValidator: function () {
         common.validatorDefaults(
            function () {
                $("#${entity?uncap_first}Form").validate({
                    ignore: [],
                    rules: {
                        userName: {// todo
                            required: true
                        }
                    },
                    messages: {
                    }
                })
            }
        );
    },
    save: function () {
         common.formSave(
            $("#${entity?uncap_first}Form"),
            {"url" : "/${entity?uncap_first}/save"}
        );
    }
}